
package com.sailing.lianxi.util.db;
import java.sql.Connection;
import java.sql.DriverManager;
public class DBTool {

    public static Connection getConnect(){
        String url = "jdbc:mysql://172.20.46.127:3306/sdrmp2?characterEncoding=UTF-8";
        String user = "sdrmp";
        String password = "111111";
        Connection connection = null;
        try {
            Class.forName("com.mysql.jdbc.Driver");
            connection = DriverManager.getConnection(url, user, password);
            System.out.println("连接成功");
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } 
        return connection;
    }
    
    public static void main(String[] args) {
        getConnect();
    }
    
}

